import routes from '../router/children';

// 根据账号 动态加载菜单
export const addMenus = (parentName, router,role) => {

  const rs = routes.filter(route => {
   if(role == 'admin' && role == route.meta.role) 
    return true;
    else if(role !== 'admin' && route.meta.role !== 'admin') return true;
    else return false;
   
  }).forEach(route => {
    
    router.addRoute(parentName, route);
  } 
  );




}